//
// C++ Interface: class_info
//
// Description: 
//
//
// Author: Os3 s.r.l. <xgui@os3.it>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//

#ifndef _XGUI_CLASS_INFO_H_
#define _XGUI_CLASS_INFO_H_

#include "base.h"

namespace xgui
{
	struct ClassInfo
	{
		public:
			ClassInfo();
			virtual ~ClassInfo();
            %feature("docstring","returns true in the object in instaceable") isInstanceable;
			virtual bool isInstanceable() = 0;
			virtual bool mustFinalize() = 0;
			%feature("docstring","returns the object name") className;
			virtual std::string const &className() = 0;
			std::string const &tag();
			%feature("docstring","define a a Document Type Definition fot the object") dtd;
			virtual std::string const &dtd();
            %feature("docstring","returns true if the object is a container (i.e.: it's castable to Container class), false otherwise") isContainer;
			virtual bool isContainer() = 0;
			%feature("docstring","returns true if the object is a widget (i.e.: it's castable to Widget class), false otherwise") isWidget;
			virtual bool isWidget() = 0;
			%feature("docstring","returns true if the object is a model (i.e.: it's castable to Model class), false otherwise") isModel;
			virtual bool isModel() = 0;
		    %feature("docstring","returns true if the object is a style manager (i.e.: it's castable to StyleManager class), false otherwise") isStyleManager;
			virtual bool isStyleManager() = 0;
            %feature("docstring","return true if the object can contain the object passed as parameter") canContain;
			virtual bool canContain(xgui::ClassInfo * c) = 0;
			%feature("docstring","return true if the object can be contained in the object passed as parameter") canBeContain;
			virtual bool canBeContainedIn(xgui::ClassInfo * c) = 0;

            %feature("docstring","associates a new property to the property array using PropertySetter and PropertyGetter") registerProperty;
			void registerProperty(std::string const &prop, xgui::PropertySetter setter, xgui::PropertyGetter getter, bool dumpable);
			%feature("docstring","returns a function pointer") PropertySetter;
			xgui::PropertySetter getPropertySetter(std::string const &prop);
			%feature("docstring","returns a function pointer") PropertGetter;
			xgui::PropertyGetter getPropertyGetter(std::string const &prop);
			std::vector<std::string> properties();
			xgui::PropertyType hasProperty(std::string const &property);

			const std::map<std::string, bool> & initProperties();
			void registerInitProperty ( const std::string & name, bool required );
			void registerMethod(std::string const &name, xgui::DMethod * m);
			
			xgui::DMethod * findMethod(std::string const &name);
            %feature("docstring","dynamically create an object in <parent> object") create;
			virtual xgui::Object * create(xgui::Object * parent, xgui::StringMap &properties) = 0;
			virtual void finalize(xgui::Object * obj) = 0;
	};
}

#endif
